/*
 * TimedWord.java
 *
 * Created on October 19, 2007, 2:08 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */



package assistedpostagger;

//~--- JDK imports ------------------------------------------------------------

import java.util.Date;

/**
 *
 * @author parezina
 */
public class TimedWord extends Word {
    private long    secondsElapsed = 0;
    private Date    startTime      = new Date();
    private boolean timerStarted   = false;
    private Integer assocToken     = null;

    /** Creates a new instance of TimedWord */
    public TimedWord() {}

    public long getSecondsElapsed() {
        return secondsElapsed;
    }

    public void startTimer() {
        startTime    = new Date();
        timerStarted = true;
    }

    public void stopTimer() {
        if (timerStarted) {
            long tempElapsed;
            Date stopTime = new Date();
            tempElapsed    = stopTime.getTime() - startTime.getTime();
            secondsElapsed += tempElapsed;
        }

        timerStarted = false;
    }

	public void setAssocToken(Integer assocToken) {
		this.assocToken = assocToken;
	}

	public Integer getAssocToken() {
		return assocToken;
	}
}


//~ Formatted by Jindent --- http://www.jindent.com
